import Dialog from "../../Game/dialog/Dialog";
import Scene from "../../Scene";
import { TButton, TLayout } from "../../SceneControl";

const { ccclass, property } = cc._decorator;

@ccclass
export default class BlackHoleGeneratorDialogScene extends Scene {

    protected onEnable(): void {
        super.onEnable();
        this.initScene();
    }

    public initScene() {
        let layout = new TLayout();
        let btns = [[]];
        cc.find("bg/buts", this.node).children.filter(item => item.active).forEach(item => {
            let t = new TButton(item);
            t.offset = cc.v3(80, 0);
            btns[0].push(t)
        })
        layout.buttonList = btns;
        this.tscene.addLayout(layout);
        this.tscene.onBack = () => {
            this.getComponent(Dialog).closeDialog();
        }
        this.tscene.joinController();
    }


}
